<!--
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<!-- 선택시 ddp-selected 추가 -->
<div [class.ddp-selectbox-disabled]="disabled"
     [class.ddp-inline]="inline"
     [ngClass]="[className]"
     (clickOutside)="this.isShowSelectList=false;">
  <div class="ddp-type-selectbox"
       (click)="toggleSelectList()"
       [ngClass]="{'ddp-selected' : isShowSelectList && isShowSelectListForOutSide, 'ddp-nowrap-r': noWrapFl, 'ddp-full' : isFull, 'ddp-flow':isDataprep}">
    <span class="ddp-txt-selectbox">
      <span *ngIf="isIconType && !(selectedItem == null || selectedItem.name == translateService.instant('msg.page.layer.map.stroke.none') || (selectedItem.isCustomField != undefined && selectedItem.isCustomField))" class="ddp-icons">
          <em class="{{getIconClass(selectedItem)}}"></em>
      </span>
      {{selectedItem == null ? unselectedMessage :  isStringArray ? selectedItem : selectedItem[viewKey] }}
    </span>
    <ul *ngIf="!isIconType" [ngClass]="{'ddp-selectdown': isUpSelect == false, 'ddp-ellipsis' : isEllipsis}"
        class="ddp-list-selectbox">
      <li *ngFor="let item of array">
        <a href="javascript:" (click)="selected(item);" title="{{isStringArray ? item : item[viewKey]}}">
          {{isStringArray ? item : item[viewKey]}}
        </a>
      </li>
      <li *ngIf="array?.length === 0">
        <span class="ddp-noresult">{{'msg.comm.ui.no.rslt' | translate}}</span>
      </li>
    </ul>

    <div *ngIf="isIconType" class="ddp-wrap-popup2">
      <ul class="ddp-list-popup">
        <li *ngFor="let item of array">
          <a href="javascript:" (click)="selected(item);">
            <span *ngIf="getIconClass(item) != ''" class="ddp-icons">
              <em class="{{getIconClass(item)}}"></em>
            </span>
            {{isStringArray ? item : item[viewKey]}}
          </a>
        </li>
        <li *ngIf="array?.length === 0">
          <span class="ddp-noresult">{{'msg.comm.ui.no.rslt' | translate}}</span>
        </li>
      </ul>
    </div>

  </div>
</div>
<!-- //Drop down -->
